<template>
	<view>

	</view>
</template>
<script>
	export default {
		data() {
			return {
				list: [],
				param: {
					limit: 10,
					page: 1
				},
				last_page: 0,
			}
		},
		onShow() {
			this.getList();
		},
		onReachBottom() {
			this.param.page++;
			if (this.param.page > this.last_page) {
				return;
			}
			this.getList();
		},
		methods: {
			getList() {
				this.$api['post']("order/order-list", this.param).then(res => {
					if (res.code == 200) {
						if (this.param.page == 1) {
							this.last_page = res.data.last_page;
							this.list = res.data.data;
						} else {
							this.list.push(...res.data.data);

						}
					}
				});
			}
		}
	}
</script>

<style>

</style>